
package com.isil.tia.aop;

import com.isil.tia.service.AuditService;

/**
 *
 * @author IVAN
 */
public class AuditAspect {

    private AuditService auditService;

    public void setAuditService(AuditService auditService) {
        this.auditService = auditService;
    }

    public AuditAspect() {
        System.out.println("");
    }

    public void grabarAuditoriaGrabados(Object entity) throws Throwable {
        auditService.saveAudit(entity, "INSERT");
    }

    public void grabarAuditoriaEliminados(Object entity) throws Throwable {
        auditService.saveAudit(entity, "DELETE");
    }
    
    
    public void grabarAuditoriaActualizados(Object entity) throws Throwable {
        auditService.saveAudit(entity, "UPDATE");
    }

}
